package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.PlugConsumeTemporaryMapper;
import com.ruoyi.consume.domain.PlugConsumeTemporary;
import com.ruoyi.consume.service.IPlugConsumeTemporaryService;

/**
 * 查看临时领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class PlugConsumeTemporaryServiceImpl implements IPlugConsumeTemporaryService
{
    @Autowired
    private PlugConsumeTemporaryMapper plugConsumeTemporaryMapper;

    /**
     * 查询查看临时领用信息
     *
     * @param plugConsumeTemporaryId 查看临时领用信息ID
     * @return 查看临时领用信息
     */
    @Override
    public PlugConsumeTemporary selectPlugConsumeTemporaryById(Long plugConsumeTemporaryId)
    {
        return plugConsumeTemporaryMapper.selectPlugConsumeTemporaryById(plugConsumeTemporaryId);
    }

    /**
     * 查询查看临时领用信息列表
     *
     * @param plugConsumeTemporary 查看临时领用信息
     * @return 查看临时领用信息
     */
    @Override
    public List<PlugConsumeTemporary> selectPlugConsumeTemporaryList(PlugConsumeTemporary plugConsumeTemporary)
    {
        return plugConsumeTemporaryMapper.selectPlugConsumeTemporaryList(plugConsumeTemporary);
    }

    /**
     * 新增查看临时领用信息
     *
     * @param plugConsumeTemporary 查看临时领用信息
     * @return 结果
     */
    @Override
    public int insertPlugConsumeTemporary(PlugConsumeTemporary plugConsumeTemporary)
    {
        plugConsumeTemporary.setCreateTime(DateUtils.getNowDate());
        return plugConsumeTemporaryMapper.insertPlugConsumeTemporary(plugConsumeTemporary);
    }

    /**
     * 修改查看临时领用信息
     *
     * @param plugConsumeTemporary 查看临时领用信息
     * @return 结果
     */
    @Override
    public int updatePlugConsumeTemporary(PlugConsumeTemporary plugConsumeTemporary)
    {
        plugConsumeTemporary.setUpdateTime(DateUtils.getNowDate());
        return plugConsumeTemporaryMapper.updatePlugConsumeTemporary(plugConsumeTemporary);
    }

    /**
     * 批量删除查看临时领用信息
     *
     * @param plugConsumeTemporaryIds 需要删除的查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deletePlugConsumeTemporaryByIds(Long[] plugConsumeTemporaryIds)
    {
        return plugConsumeTemporaryMapper.deletePlugConsumeTemporaryByIds(plugConsumeTemporaryIds);
    }

    /**
     * 删除查看临时领用信息信息
     *
     * @param plugConsumeTemporaryId 查看临时领用信息ID
     * @return 结果
     */
    @Override
    public int deletePlugConsumeTemporaryById(Long plugConsumeTemporaryId)
    {
        return plugConsumeTemporaryMapper.deletePlugConsumeTemporaryById(plugConsumeTemporaryId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<PlugConsumeTemporary> getUserName(){
        return plugConsumeTemporaryMapper.getUserName();
    }
}
